package june.overlayfilter;

import android.content.Context;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.ColorFilter;
import android.graphics.Paint;
import android.graphics.Paint.Style;
import android.graphics.Typeface;
import android.graphics.drawable.Drawable;

public class MapDrawable extends Drawable{
	
	Bitmap maker;
	String text;
	
	Paint paint;
	
	public MapDrawable(int makerID, String text, Context context){
		
		Bitmap maker = BitmapFactory.decodeResource(context.getResources(), makerID);
		
		this.maker = maker;
		this.text = text;
		
		paint = new Paint();
		paint.setTextSize(25);
		paint.setAntiAlias(true);
		paint.setTypeface(Typeface.DEFAULT_BOLD);
		paint.setColor(Color.RED);
		paint.setStyle(Style.STROKE);
		paint.setStrokeWidth(5);
		
		
	}
	

	@Override
	public void draw(Canvas canvas) {
		// TODO Auto-generated method stub
		
		canvas.translate(-maker.getWidth()/2, -maker.getHeight());
		canvas.drawBitmap(maker, 0, 0, paint);
//		canvas.drawText(text, 0, 0, paint);
//		canvas.drawRect(0, 0, canvas.getWidth(), canvas.getHeight(), paint);
//		canvas.drawCircle(0, 0, 10, paint);
	}

	@Override
	public int getOpacity() {
		// TODO Auto-generated method stub
		return 0;
	}

	@Override
	public void setAlpha(int alpha) {
		// TODO Auto-generated method stub
		
	}

	@Override
	public void setColorFilter(ColorFilter cf) {
		// TODO Auto-generated method stub
		
	}
	
	@Override
	public int getIntrinsicWidth() {
		// TODO Auto-generated method stub
		return maker.getWidth();
	}

}
